﻿using Engine;
namespace Mekiasm.ElectricElement
{
    public class WindGeneratorElement : Common.ElectricElement
    {
        public WindGeneratorElement(int x, int y, int z) : base(x, y, z)
        {


        }

        public override bool Simulate()
        {
            var Component = Instance.Machine;
            int h = (int)MathUtils.Clamp((double)Point.Y, 0, 200);
            float windP = (float)h / 200;
            int P = (int)(windP * 24);
            Component.Power = MathUtils.Min(Component.MaxPower, Component.Power + P);
            ChargeOrDischargeItem(0);
            return true;
        }

    }
}
